package cn.njxzc.demo.bam;

/**
 * Bank Account
 *
 * @author Zhou Nan
 */
public class Account {
    private long id;
    private String password;
    private String realName;
    private String personId;
    private String email;
    private double balance;

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public long getId() {
        return id;
    }

    public String getRealName() {
        return realName;
    }

    public String getPersonId() {
        return personId;
    }

    public Account() {
    }

    public Account(long id, String password, String realName, String personId) {
        this.id = id;
        this.password = password;
        this.realName = realName;
        this.personId = personId;
    }

    public boolean deposit(double money) {
        balance += money;
        return true;
    }

    public boolean withdraw(double money) {
        if (money > balance) {
            return false;
        } else {
            balance -= money;
            return true;
        }
    }


}
